package RobotPlayer
{
	import BasicEngine.Vector2D;
	/**
	 * 一个计算合力的类
	 */
	public class Resultant
	{
		public var Robot:BaseRobot;
		public function Resultant(_robot:BaseRobot)
		{
			Robot = _robot;
		}
		
		/**
		 * 返回一个操控实体到达目标位置的力
		 */
		public function Seek(_targetPos:Vector2D):Vector2D
		{
			var desiredVelocity:Vector2D = ((_targetPos.Subtract(Robot.Pos)).Normalize()).CrossProduct(Robot.MaxSpeed);
			var result:Vector2D = desiredVelocity.Subtract(Robot.Velocity);
			return result;		    
		}
	}
}